package Code.Polymorphsm.Demo1;

public class Test {

    public static void main(String[] args) {

        Administrator administrator = new Administrator();
        administrator.setName("张三");
        administrator.setAge(24);
        register(administrator);

        Student student = new Student();
        student.setName("李四");
        student.setAge(25);
        register(student);

        Teacher teacher = new Teacher();
        teacher.setName("王五");
        teacher.setAge(26);
        register(teacher);


    }

    //register能接收学生老师管理员
    public static void register(Person p){
        p.show();
    }
}
